<%if @cultural_heritage_care_and_maintenances.size > 0 %>

<table id="care_and_maintenances_table" class="paginated_table sorted_table" >
  <thead>
  <tr>
    <th>Encargado</th>
    <th>Descripción</th>
    <th>Fecha Inicio</th>
    <th>Fecha Fin</th>
    <th>Institución Cultural</th>
    <th>Patrimonio Cultural</th>
    <th>Tipo</th>
    <th style="min-width: 140px;">Acciones</th>
  </tr>
  </thead>

  <tbody>

  <% @cultural_heritage_care_and_maintenances.each do |cultural_heritage_care_and_maintenance| %>

  <tr>
    <td><%= cultural_heritage_care_and_maintenance.obj_security_people.name + " " + cultural_heritage_care_and_maintenance.obj_security_people.lastname%></td>
    <td><%= cultural_heritage_care_and_maintenance.description %></td>
    <td><%= cultural_heritage_care_and_maintenance.start_date %></td>
    <td><%= cultural_heritage_care_and_maintenance.end_date %></td>
    <td><%= cultural_heritage_care_and_maintenance.obj_cultural_institution.name %></td>
    <td><%= cultural_heritage_care_and_maintenance.obj_cultural_heritage.name %></td>
    <td>
      <%if !cultural_heritage_care_and_maintenance.care_and_maintenance_type.blank?%> 
        <%= cultural_heritage_care_and_maintenance.obj_care_and_maintenance_type.name %>
      <%end%>
    </td>

    <td>
      <%= link_to image_tag("navi/search-16-ns.png", :border => 0, :title => 'Mostrar'), cultural_heritage_care_and_maintenance %>
   
        <%if current_user.role == 4 or current_user.role == 2%>
          
          <%= link_to image_tag("navi/pencil-16-ns.png", :border => 0, :title => 'Editar'), edit_cultural_heritage_care_and_maintenance_path(cultural_heritage_care_and_maintenance)  %>
          <%= link_to image_tag("navi/cross-16-ns.png", :border => 0, :title => 'Eliminar'), cultural_heritage_care_and_maintenance, :confirm => 'Esta Seguro?', :method => :delete %>
          <%#= link_to image_tag("navi/badge-square-check-16-ns.png", :border => 0, :title => 'Magnitud'), {:action => 'is_mayor',:id => cultural_heritage_care_and_maintenance.id}, :confirm => '¿Seguro que el cuidado y mantenimiento es de magnitud Mayor?' %>
          <%#= link_to image_tag("navi/badge-square-check-16-ns.png", :border => 0, :title => 'Magnitud'), edit_cultural_heritage_care_and_maintenance_path(cultural_heritage_care_and_maintenance), :confirm => '¿Seguro que el cuidado y mantenimiento es de magnitud Mayor?' %>
          <%if cultural_heritage_care_and_maintenance.status == 1 %>
            <img border="0" title="Aprobado" src="/images/navi/bien.png" alt="Aprobado"/>
          <% elsif cultural_heritage_care_and_maintenance.status == 2 %>
            <img border="0" title="Desaprobado" src="/images/navi/mal.png" alt="Desaprobado"/>
          <% else %>
            <%= link_to image_tag("navi/badge-square-check-16-ns.png", :border => 0, :title => 'Procede', :alt => 'Procede'), {:action => 'proceed',:id => cultural_heritage_care_and_maintenance.id}, :confirm => '¿Está seguro que el cuidado y mantenimiento procede?' %>
            <%= link_to image_tag("navi/badge-square-minus-16-ns.png", :border => 0, :title => 'No procede', :alt => 'No procede'), {:action => 'notapplicable',:id => cultural_heritage_care_and_maintenance.id}, :confirm => '¿Está seguro que el cuidado y mantenimiento no procede?' %>
          <%end%>
        <%end%>
    </td>

    <%# if cultural_heritage_care_and_maintenance.s==1 %>
    <%#*<td>%>
      <%#*<label> A </label>%>
    <%#*</td>%>
    <%#end%>

  </tr>
  
<% end %>
  </tbody>
</table>

<%  else %>

  <p>Ningún Registro fue encontrado</p>

<%  end %>
